#include <iostream>

using namespace std;


int	main(int argc, char **argv)
{
  // Lambda 函数表达式
  // auto fn = [](int x, int y) -> int {
  //   int z = 10;
  //   return z + x + y;
  // };
 auto basicLambda = [] { cout << "Hello, world!" << endl; };
 basicLambda();

 auto fn = [](int x, int y) -> int { return x + y; };

 cout << fn(10, 20) << endl;

 int y = 11;
 int x = 10;
 auto fn1 = [x, &y](int m, int &n) -> int { n = 20; return n; };

 cout << fn1(x, y) << endl;

 cout << y << endl;

 // system("pause");
 return 0;
}

